<template>
	<div class="wraper">
		<div class="top" :class="{isIphoneX:isIphoneX,iphone:isIphone}">
			<div class="nav-bar">
				<div class="arrow" @click="goBack"></div>
				<span @click="goHistory">{{$t('transfer-key1')}}</span>
			</div>
			<h1>{{$t('transfer-key2',{name:defaultIcon})}}</h1>
			<div class="choice-name" @click="choiceIcon">
				<span>{{$t('transfer-key3')}}</span><span :class="{ni:isNi}">{{defaultIcon}}</span>
			</div>
		</div>
		<div class="items" :class="{only:only===3}">
			<div class="item" :class="{arrow:accountList1.length > 0}" @click="choiceAccount1">
				<span>{{$t('transfer-key4')}}</span>
				<b>{{from.name}}</b>
			</div>
			<div class="item" :class="{arrow:accountList2.length > 0}" @click="choiceAccount2">		
				<span>{{$t('transfer-key5')}}</span>
				<b>{{to.name}}</b>
			</div>
			<div class="btn" @click="change"></div>
		</div>
		<div class="main">
			<h2>{{$t('transfer-key8',{name:defaultIcon})}}</h2>
			<input type="number" @blur="amountBlur" v-model="amount" placeholder="0.00">
			<h3>
				<span>
					{{$t('transfer-key9')}}
					<van-button class="icon-loading" v-if="allAmount===''" loading color="#fff" type="primary" loading-type="spinner" />
					<b v-else>{{allAmount}}</b>
				</span>
				<i @click="sellAll">{{$t('transfer-key10')}}</i>
			</h3>
		</div>
		<div class="btn-box">
			<van-button :loading-text="$t('transfer-key12')" @click="upload" :loading="loading" class="btn" type="primary">{{$t('transfer-key2',{name:''})}}</van-button>
		</div>
		<div class="desc" v-if="locale==='zh'">{{$t('transfer-key16')}}<span @click="jump">{{$t('transfer-key17')}}</span></div>
		<!-- 币种选择 -->
		<van-action-sheet 
			class="iconBox" 
			:class="{isIphoneX:isIphoneX}"
			v-model="iconShown" 
			:actions="iconList" 
			:cancel-text="$t('cancel')" 
			@select="selectIcon" 
		/>
		<!-- 转出账户 -->
		<van-action-sheet 
			class="iconBox" 
			:class="{isIphoneX:isIphoneX}"
			v-model="accountShown1" 
			:actions="accountList1" 
			:cancel-text="$t('cancel')" 
			@select="selectAccount1" 
		/>
		<!-- 转入账户 -->
		<van-action-sheet 
			class="iconBox" 
			:class="{isIphoneX:isIphoneX}"
			v-model="accountShown2" 
			:actions="accountList2" 
			:cancel-text="$t('cancel')" 
			@select="selectAccount2" 
		/>
	</div>
</template>
<script src="./transfer2.js"></script>
<style>
	.fullDialog2 .van-dialog__header{
		padding-top: 18px;
		color: #222;
	}
	.fullDialog2 .van-dialog__content{
		padding-bottom: 10px;
    	font-weight: normal;
	}
</style>
<style scoped>
	@import './transfer2.css';
</style>